import { Connection, Model, Schema } from "mongoose";
interface BarrierAttributes {
  transType: string;
  gid: string;
  branchId: string;
  op: string;
  barrierId: string;
  reason: string;
}

export let Barrier: Model<BarrierAttributes>

export function initModel(connection: Connection, tableName = 'barrier'): void {
  Barrier = connection.model(tableName,  new Schema({
    transType: String,
    gid: String,
    branchId: String,
    op: String,
    barrierId: String,
    reason: String
  })) as any;
}

